- /* srodbdvf.cpp by K.Tsuru */
- // function ID = 827 BRADIX
- /*********************
- SRational class
- operator d/SR
- d/(N/D) = (d*D)/N
- **********************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- SRational operator/(double d, const SRational& n){
- if(n.Sign() == 0) n.num.SetError(n.num.DIVIDED_BY_ZERO,"double/SR", 827);
-
- SRational r;
- if(d == 0.0) r.SetZero();
- else if(fabs(d) == 1.0L){
- r.Set(n.DenNR(), n.NumNR());
- if(d < 0.0) r.num.ChangeSign(); //r = -r;
- r.reduceDone = n.reduceDone;
- }else r.Set((SInteger)d*n.DenNR(), n.NumNR()); // includes r.reduce(false);
- return r;
- }
srodbdvf.cpp : last modifiled at 2016/06/26 16:29:28(607 bytes)
created at 2016/06/26 15:57:35
The creation time of this html file is 2016/09/18 20:28:05 (Sun Sep 18 20:28:05 2016).